<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="../../jsfile/layer.css"/>
    <script src="../../jsfile/jquery.js"></script>
    <script src="../../jsfile/layer.js"></script>
    <script src="../../jsfile/base.js"></script>

    <script type="text/javascript">
        var arr = [];//定义一个数组
        arr[0] = 12;
        arr[2] = "abc";
        // alert(arr[0]);
        // alert(arr.length);//3  数组的长度

        // alert(arr[1]);//undefined

        //数组的遍历
        for (var i = 0 ; i < arr.length ; i++){
            alert(arr[i]);
        }

    </script>


</head>
<body>
<p id="text_show">
1:在javascript语言中的数组,只要我们通过数组下标赋值,那么最大的下标值,就会自动的给数组做扩容操作

</p>
<div class="look_source_code" onclick="getPageContent()">查看源码</div>

</body>


</html>


